home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-21 | 1.2 KB | 46 lines | [TEXT/ttxt] |
- in module DemoModule
-
- --*******************************************************************************
- --* Class name: ButtonShape
- --*
- --* Inherits from: TwoDShape and Button
- --* Class type: Concrete
- --* Component: User Interface
- --*
- --* Description: This class is an example of how to mix in the Button class
- --* with a TwoDShape to produce a simple, yet fully functional
- --* 'pushbutton'.
- --*
- --* Usage: bs := new ButtonShape releasedBitmap:<some bitmap> \
- --* pressedBitmap:<some bitmap>
- --*
- --* IVs: none
- --*
- --* Methods: setPressedAppearance
- --* setReleasedAppearance
- --*
- --* Required files: button.sx
- --*
- --* Notes:
- --*
- --* Author: Su Quek - Kaleida Labs, Inc.
- --*******************************************************************************
- class ButtonShape (TwoDShape, Button)
- end
-
- -- The following methods are specialized to produce custom appearances.
- -- In this example, when the button is pressed, a red stroke appears around
- -- the bitmap.
-
- method setPressedAppearance self {class ButtonShape} ->
- (
- nextmethod self
- self.stroke := (new Brush color:redColor)
- )
-
- method setReleasedAppearance self {class ButtonShape} ->
- (
- nextmethod self
- self.stroke := undefined
- )
-